PROJECT(itkgdcm)
# We need ITK
FIND_PACKAGE(ITK REQUIRED)

# Define the src for the itk-gdcm bridge
SET(itkgdcm_SRCS
  itkGDCMImageIO2.cxx
  )

INCLUDE(${ITK_USE_FILE})
INCLUDE_DIRECTORIES(
  BEFORE
  ${GDCM_BINARY_DIR}/Source/Common
  ${GDCM_SOURCE_DIR}/Source/Common
  ${GDCM_SOURCE_DIR}/Source/DataStructureAndEncodingDefinition
  ${GDCM_SOURCE_DIR}/Source/MediaStorageAndFileFormat
  ${GDCM_SOURCE_DIR}/Source/DataDictionary
  )

ADD_LIBRARY(itkgdcm ${itkgdcm_SRCS})
SET_TARGET_PROPERTIES(itkgdcm PROPERTIES ${GDCM_LIBRARY_PROPERTIES})

TARGET_LINK_LIBRARIES(itkgdcm gdcmMSFF ITKIO)
IF(NOT GDCM_INSTALL_NO_LIBRARIES)
  INSTALL(TARGETS itkgdcm
    RUNTIME DESTINATION ${GDCM_INSTALL_BIN_DIR} COMPONENT Runtime
    LIBRARY DESTINATION ${GDCM_INSTALL_LIB_DIR} COMPONENT Runtime
    ARCHIVE DESTINATION ${GDCM_INSTALL_LIB_DIR} COMPONENT Development
  ${CPACK_NAMELINK_TYPE}
  )
ENDIF(NOT GDCM_INSTALL_NO_LIBRARIES)

IF(BUILD_TESTING)
  SUBDIRS(Testing)
ENDIF(BUILD_TESTING)

IF(BUILD_APPLICATIONS)
  SUBDIRS(Applications)
ENDIF(BUILD_APPLICATIONS)

